/**
 * Copyright (c) 2011 eelpo.com
 * All rights reserved.
 */
package com.eelpo.common.query.criteria;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;

import com.eelpo.common.query.expression.JoinExpression;
import com.eelpo.common.query.expression.OrderExpression;
import com.eelpo.common.query.expression.ParameterCriterion;
import com.eelpo.common.query.expression.ResultExpression;

/**
 * <pre>
 * 
 * Criteria接口
 * 
 * </pre>
 * 
 * @author <a href="mailto:Brian@eelpo.com">汪洪州</a>
 * @since 1.0
 */
public interface Criteria {

	public static final String SELECT = "SELECT ";

	public static final String FROM = "FROM ";

	public static final String WHERE = " WHERE";

	public static final String ORDERBY = " ORDER BY ";

	public Criteria clear();

	public Criteria clearResults();

	public Criteria clearConditionals();

	public Criteria clearJoins();

	public Criteria clearOrders();

	public Criteria clearHints();

	public Criteria change(Class<? extends Serializable> entityClass);

	public Criteria change(Class<? extends Serializable> entityClass, String alias);

	public Criteria changes(Class<? extends Serializable> entityClass);

	public Criteria changes(Class<? extends Serializable> entityClass, String alias);

	public Criteria alias(String alias);

	public Criteria result(ResultExpression criterion);

	public Criteria add(ParameterCriterion criterion);

	public Criteria join(JoinExpression criterion);

	public Criteria order(OrderExpression criterion);

	public Criteria setHint(String hint, Object value);

	public String getJpql();

	public Collection<Object> getParameters();

	public int getFirstResult();

	public Criteria setFirstResult(int size);

	public int getMaxResults();

	public Criteria setMaxResults(int size);

	public boolean isPaging();

	public Map<String, Object> getHints();

	public StringBuilder getJpql(StringBuilder jpql);

	public Collection<Object> getParameters(Collection<Object> parameters);
}
